import socket

# User input for the message to send
message = input("Enter the message to send:")

# IPv6 address and port of the target server
target_ipv6 = input("Enter the target server's IPv6 address:")
target_port = int(input("Enter the target server's port number:"))

# Create a socket connection
client_socket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)

# Connect to the target server
client_socket.connect((target_ipv6, target_port))

# Set the number of repetitions for sending
repeat_times = int(input("Enter the number of times to repeat sending:"))

# Loop to send the message to the target server
for i in range(repeat_times):
    client_socket.send(message.encode())
    print("Sent", i+1, "times")

# Close the socket connection
client_socket.close()
